#include <Threads/ClientSessionThread.hpp>

ClientSessionThread::ClientSessionThread(TCPConnection *tcpConnection){

	this->tcpConnection = tcpConnection;

	/* Start new thread to serve client */

}

ClientSessionThread::~ClientSessionThread(){

	/* Close connection */
//	tcpConnection->closeConnection();
//	delete(tcpConnection);
}


void ClientSessionThread::run(){

	while(tcpConnection->isConnected()){
		/* loop as long as connection is open */

		char rawInput;
		std::string inputStr;

		do{
			/* Read string byte by byte until null termination is reached */
			tcpConnection->receiveData(&rawInput, 1);
			inputStr.append(&rawInput,1);

		}while(rawInput != 0);

		if(inputStr.length() > 1){


		}
	}

}

